<?php
namespace Admin\Controller;

class ProjectScoreController extends AbstractController  {
	
	protected $Form;

	public function _initialize(){
		$this->assign("busid",I("busid"));
		$this->assign("formid",I("formid"));
		$this->Form = D('Projectscorecheck');
		$res = $this->Form->getProjectList();
		$this->assign("data",$res);
		$this->assign("projectID",I("id"));
    }
    
    public function index(){
    	$res = $this->Form->MyshowList();
		$this->assign("list",$res['list']);
    	$this->assign("page",$res['page']);
		$this->display("Project/ProjectScore/index");
    }
    
    public function add(){
    	if(IS_POST){
 			$result = $this->Form->Myadd();
 			if($result['state'] == 1 && !empty($result)){
				$this->success($result['msg']);
			}else if($result['state'] == 0 && !empty($result)){
				$this->error($result['msg']);
			}
   		}else{
    		$this->display("Project/ProjectScore/save");
    	}
    }
    
    public function edit(){
    	if(I('ID')){
			$res = $this->Form->Myshow(array("ID" => (int)I('ID')));
			$this->assign("editdata",$res);
		}
		$this->display("Project/ProjectScore/save");
    }
    
    public function update(){
    	if(IS_POST){
    		$result = $this->Form->Mydata();
    		if($result['state'] == 1 && !empty($result)){
				$this->success($result['msg']);
			}else if($result['state'] == 0 && !empty($result)){
				$this->error($result['msg']);
			}
    	}
    }
    
    public function delete(){
		if(I('ID')){
			$result = $this->Form->Mydelet();
    		if($result['state'] == 1 && !empty($result)){
				$this->success($result['msg']);
			}else if($result['state'] == 0 && !empty($result)){
				$this->error($result['msg']);
			}
		}
    }
    

}